<template>
  <div class="home">
    <swipes-2></swipes-2>
    <collocation-2></collocation-2>
    <various
      :ftId="1"
      :varName="'中式菜系'"
      :ftHref="'/rankingchinese'"
    ></various>
    <various
      :ftId="2"
      :varName="'传统美食'"
      :ftHref="'/rankingtradition'"
    ></various>
    <various
      :ftId="3"
      :varName="'外国美食'"
      :ftHref="'/rankingdesserts'"
    ></various>
    <various
      :ftId="4"
      :varName="'甜品/饮品'"
      :ftHref="'/rankingamerican'"
    ></various>
    <trends></trends>
    <bottom></bottom>
  </div>
</template>

<script>
import Collocation2 from "../../components/collocation/Collocation2.vue";
import Trends from "../../components/trends/Trends.vue";
import Various from "../../components/various/Various.vue";
import Swipes2 from "../../components/swipe/swipes2.vue";
import Bottom from "../../components/bottom/Bottom.vue";

export default {
  components: { Collocation2, Trends, Various, Swipes2, Bottom },
  name: "Homepage",
  data() {
    return {
      input: "",
    };
  },
  mounted() {
    history.pushState(null, null, document.URL);
    window.addEventListener("popstate", function () {
      console.log(1);
      history.pushState(null, null, document.URL);
    });
  },
  methods: {
    childByValue: function (childValue) {
      // childValue就是子组件传过来的值
      this.input = childValue;
    },
  },
};
</script>

<style>
.home {
  width: 100%;
}
</style>
